﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<ChoViet.CMS.ViewModels.AdTabsViewModel>" %>
<%@ Import Namespace="ChoViet.Lib.Common"%>
<%@ Import Namespace="ChoViet.Lib.Helpers" %>
<div class="laptop">
    <a href="<%=LinkUtils.UrlAdIndexDefault("",Model.Category.ShortName,"","","",0)%>" title="<%=Model.Category.Name%>"><h3><%=Model.Category.Name%></h3></a>
    <ul id="computer">
        <%foreach (var child in Model.Category.Categories)
          {%>
             <li><a href="<%=LinkUtils.UrlAdIndexDefault("",child.ShortName,"","","",0)%>" title="<%=child.Name %>" ><%=child.Name %></a></li>         
          <%} %>
          <%--<div id="ProgressStatus_<%=Model.Category.ID%>" class="loadListTabs"><img src="/Images/LoadProgress.gif" /></div>--%>
    </ul>
    <div class="viewall">
        <a class="viewall" href="<%=LinkUtils.UrlAdIndexDefault("",Model.Category.ShortName,"","","",0)%>">Xem tất cả&raquo;&raquo;</a>
    </div>
    <div class="clear"></div>
</div>
<div class="clear"></div>
<div id="listAdTabs_<%=Model.Category.ID%>"></div>
<%foreach (var item in Model.Ads)
  {%>
    <div class="content-item">
            <%var LinkTodetails = Html.AdDetailRoute(item); %>
            <a href="<%=LinkTodetails%>"><img class="avatar" src="<%=LinkUtils.UrlImageOrDefault(item.Image)%>" /></a>
                <a href="<%=LinkTodetails%>"><%= Html.Encode(item.Title.Length > 50 ? item.Title.Substring(0, 50) + ".." : item.Title)%><%=Utils.CheckNewAdToDay(item.ModifyDate.Value)%></a>
                <h5>L.xem:<span class="hightlight" style="color:#EC1C24"><%= string.IsNullOrEmpty(item.ViewNumber.ToString()) ? 0 : item.ViewNumber %></span></h5>
                <div class="clear"></div>
                <div class="info">
                  <span class="hightlight"><%=Utils.DateTimeToStringFormat(item.ModifyDate.Value)%></span>..
                  <span class="ss1"><h5>Tại: <span class="hightlight"><%= Html.Encode(item.DistrictID != null ? item.City.Districts.FirstOrDefault(e => e.ID == item.DistrictID).Name + " - " + item.City.Name : item.City.Name)%></span></h5></span>     
                </div>
        <div class="clear"></div>
     </div>
<%} %>

